package com.foreknow.elmboot.mapper;

import com.foreknow.elmboot.po.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserMapper {
    /**
     * 根据用户名密码查询用户信息
     *登录
     * @param userId
     * @param password
     * @return
     */
    @Select("SELECT * from user where userId=#{userId} and password=#{password}")
    User getUser(String userId, String password);

    /**
     * 添加用户信息
     * 注册
     * @param user
     * @return
     */
    @Insert("insert into user (userId,password,userName,userSex,delTag) value (#{userId},#{password},#{userName},#{userSex},1)")
    int addUser(User user);

}
